package com.shensi.api.admin.client.customer;

import com.shensi.api.admin.client.fallback.customer.IcRegisteInfoClientFallBack;
import com.shensi.api.admin.domian.customer.dto.IcRegisteInfoDto;
import com.shensi.common.core.constant.CloudConstant;
import com.shensi.common.core.domain.AjaxResult;
import com.shensi.common.core.page.TableDataInfo;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author: budian
 * @since: 2023/12/12
 */
@FeignClient(
        value = CloudConstant.ADMIN_SERVER,
        fallbackFactory = IcRegisteInfoClientFallBack.class)
@Component
public interface IcRegisteInfoClient {

    /**
     * 查询卡编号列表
     */
    @GetMapping("/customer/ic/list")
    public TableDataInfo list(@SpringQueryMap IcRegisteInfoDto icRegisteInfo);

    @GetMapping("/statisticsInfo")
    public AjaxResult statisticsInfo(@SpringQueryMap IcRegisteInfoDto icRegisteInfo);

    /**
     * 导出卡编号列表
     */
    @GetMapping("/customer/ic/export")
    public AjaxResult export(@SpringQueryMap IcRegisteInfoDto icRegisteInfo) ;

    /**
     * 修改密码
     */
    @PostMapping(value = "/customer/ic/resetpwd")
    public AjaxResult Resetpwd(@RequestBody IcRegisteInfoDto icRegisteInfo);

    /**
     * 现金充值U
     */
    @PostMapping(value = "/customer/ic/updateRecharge")
    public AjaxResult UpdateRecharge(@RequestBody IcRegisteInfoDto icRegisteInfo);

    /**
     * 现金充值U
     */
    @PostMapping(value = "/customer/ic/UpdateRechargeByAfter")
    public AjaxResult UpdateRechargeByAfter(@RequestBody IcRegisteInfoDto icRegisteInfo);

    /**
     * 现金消费
     */
    @PostMapping(value = "/customer/ic/updateconsumption")
    public AjaxResult updateconsumption(@RequestBody IcRegisteInfoDto icRegisteInfoReq) ;

    /**
     * 现金消费
     */
//    @PostMapping(value = "/customer/ic/updateconsumptionByAfter")
//    public void updateconsumptionByAfter(@RequestBody IcRegisteInfoDto icRegisteInfo, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException ;

    /**
     * 修改密码
     */
    @PostMapping(value = "/customer/ic/updateIcRegisteInfo")
    public AjaxResult updateIcRegisteInfo(@RequestBody IcRegisteInfoDto icRegisteInfo);

    /**
     * 修改卡编号
     */
    @PutMapping(value = "/customer/ic/put")
    public AjaxResult edit(@RequestBody IcRegisteInfoDto icRegisteInfo);

    @PostMapping(value = "/customer/ic/updatecancellation")
    public AjaxResult updatecancellation(@RequestBody IcRegisteInfoDto icRegisteInfo);

    /**
     * 获取卡编号详细信息
     */
    @GetMapping(value = "/customer/ic/getcardno/{icCardno}")
    public AjaxResult getInfo(@PathVariable("icCardno") String icCardno);

    /**
     * 新增卡编号
     */
    @PostMapping("/customer/ic/save")
    public AjaxResult add(@RequestBody IcRegisteInfoDto icRegisteInfo);

}
